// Lang_29 [Thread class].nova // The application class. class ThreadClassApp { // Application class's "main" function. public static void main( String[] args ) { ThreadTester threadTester = new ThreadTester( ); Thread threadIRun = new Thread( threadTester, "iRunMethodArg" ); threadIRun.start( ); Object returnObject = threadIRun.getReturnValue( ); Stream.write( "return object = " ); Stream.writeLine( returnObject.toString( ) ); // Pause between the threads. Thread.sleep( 3000 ); // Create a new thread to use the static method. Thread threadStaticProc = new Thread( threadProc, "staticMethodArg" ); threadStaticProc.start( ); returnObject = threadStaticProc.getReturnValue( ); Stream.write( "return object = " ); Stream.writeLine( returnObject.toString( ) ); } private static Object threadProc( Object arg ) { Stream.writeLine( "ThreadClass.threadProc( ) - called" ); Stream.write( "arg = " ); Stream.writeLine( arg.toString( ) ); // Delay the thread. Thread.sleep( 3000 ); return arg; } } class ThreadTester : IRun { public Object run( Object arg ) { Stream.writeLine( "ThreadTester.run( ) - called" ); Stream.write( "arg = " ); Stream.writeLine( arg.toString( ) ); // Delay the thread. Thread.sleep( 3000 ); return arg; } }